import { defineComponent, ref, watchEffect, openBlock, createElementBlock, Fragment, renderList, renderSlot, createElementVNode, toDisplayString, createVNode, unref } from "vue";
import "../icons/index.mjs";
import CloseIcon from "../icons/close-icon.vue.mjs";
const _hoisted_1 = { class: "me-select-member-item" };
const _hoisted_2 = ["title"];
const _sfc_main = /* @__PURE__ */ defineComponent({
  __name: "select-member-item",
  props: {
    dataSource: { default() {
      return [];
    } }
  },
  emits: ["delete"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emits = __emit;
    const memberList = ref([]);
    watchEffect(() => {
      memberList.value = props.dataSource || [];
    });
    const onDelete = (member) => {
      member.memberSelected = false;
      emits("delete", member);
    };
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1, [
        (openBlock(true), createElementBlock(Fragment, null, renderList(memberList.value, (member, index) => {
          return openBlock(), createElementBlock("div", {
            key: index,
            class: "me-select-member-item-list"
          }, [
            renderSlot(_ctx.$slots, "select-member", { member }, () => [
              createElementVNode("span", {
                class: "me-select-member-item-name",
                title: member.title
              }, toDisplayString(member.title), 9, _hoisted_2),
              createVNode(unref(CloseIcon), {
                class: "me-select-member-item-delete-icon",
                onClick: ($event) => onDelete(member)
              }, null, 8, ["onClick"])
            ])
          ]);
        }), 128))
      ]);
    };
  }
});
export {
  _sfc_main as default
};
//# sourceMappingURL=select-member-item.vue2.mjs.map
